//base_class.cpp
//four cases of generating implicit, nontrivial default constructors
//1. member object
//2. base class
//3. virtual function(vtbl and vptr)
//4. virtual base class
//two common misunderstanding
//1. A default constructor is synthesized for every class that does not define one
//2. The compiler-synthesized default constructor provides 
//   explicit default initializers for each data member declared within the class
//   (Except 1. global 2. name space 3. class static)

#include <iostream>
#include <cstdio>
using namespace std;

//member class object
class Foo0
{
public:
  Foo0(){ cout<<"Foo0()"<<endl;}
};

class Foo1
{
public:
  Foo1(){ cout<<"Foo1()"<<endl;}
};

class Bar
{
public:
  Bar() { cout<<"Bar()"<<endl; }
};
class FooBar:public Foo0,public Foo1
{
  Foo0 foo0;
  Bar bar;
public:
  FooBar():bar() {cout<<"FooBar()"<<endl; }
};

int main(void)
{
 
  FooBar foobar;

  return 0;
}
